{extend name="layout" /}

{block name="breadcrumb"}
<h2>{$title}</h2>
<ol class="breadcrumb">
    <li><a href="{:url('index/index')}">首页</a></li>
    <li><a href="{:url('index')}">管理员列表</a></li>
    <li><strong>{$title}</strong></li>
</ol>
{/block}

{block name="main"}
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>{$title}</h5>
    </div>
    <div class="ibox-content">
        <form method="post" class="form-horizontal" onsubmit="return toSubmit()">
            <div class="form-group">
                <label class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-6">
                    <input type="text" name="user_name" value="{$model ? $model.user_name : ''}" class="form-control" placeholder="请输入用户名" required />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">密码</label>
                <div class="col-sm-6">
                    <input type="password" name="password" class="form-control" placeholder="请输入密码" />
                </div>
                {if ( $model ) }
                <label class="col-sm-3 padding-top-7 text-danger">为空不修改</label>
                {/if}
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">确认密码</label>
                <div class="col-sm-6">
                    <input type="password" name="rePassword" class="form-control" placeholder="请输入确认密码" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">手机号码</label>
                <div class="col-sm-6">
                    <input type="text" name="mobile" value="{$model ? $model.mobile : ''}" class="form-control" placeholder="请输入手机号码" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">状态</label>
                <div class="col-sm-6">
                    <select name="status" class="form-control" required>
                        {foreach $status as $key=>$vo }
                        {if ( $model && $model.status == $key ) }
                        <option value="{$key}" selected>{$vo}</option>
                        {else /}
                        <option value="{$key}">{$vo}</option>
                        {/if}
                        {/foreach}
                    </select>
                </div>
            </div>

            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    {if ( $model && $model.id > 0) }
                    <input type="hidden" name="id" value="{$model.id}">
                    {/if}

                    <button class="btn btn-primary" type="submit">提交</button>
                    <button class="btn btn-white" type="button"><a href="{:url('index')}">取消</a></button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
